#include "supersonic.h"

SuperSonic::SuperSonic(int pin1, int pin2, int pin3,int pin4,int pin5){
	rx_pin = pin1;
	tx_pin = pin2;
	button_pin = pin3;
	rxa_pin=pin4;
	txa_pin=pin5;
}

void SuperSonic::init(){
	pinMode(rx_pin, INPUT);
	pinMode(tx_pin, INPUT); 
	pinMode(rxa_pin, INPUT);
	pinMode(txa_pin, INPUT); 
	pinMode(button_pin,INPUT);

}

float SuperSonic::getDistance(){
	// �Լ���ȫ����
}
int SuperSonic::getLeftLightTrack(){
	return digitalRead(tx_pin);
}
int SuperSonic::getRightLightTrack(){
	return digitalRead(rx_pin);
}
int SuperSonic::getButtonValue(){
	return digitalRead(button_pin);
}
int SuperSonic::getLeftLightAvoid(){
	return digitalRead(txa_pin);
}
int SuperSonic::getRightLightAvoid(){
	return digitalRead(rxa_pin);
}